From 54b1b3175b453aabea65a3d02888a88a915ade92 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 13 Dec 2021 22:14:41 +0100
Subject: [PATCH] add otf generation

---
 Makefile | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3efbe26..3c15e58 100644
--- a/Makefile
+++ b/Makefile
@@ -42,11 +42,13 @@ VARIANTS     = \
 
 DISTPREFIX     := liberation-fonts-$(VER)
 DISTPREFIX_TTF := liberation-fonts-ttf-$(VER)
+DISTPREFIX_OTF := liberation-fonts-otf-$(VER)
 SFDFILES       := $(addprefix $(SRCDIR)/$(NAME),    $(VARIANTS:=.sfd))
 TTFFILES       := $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.ttf))
+OTFFILES       := $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.otf))
 
 # keeping backward compatibility for "build"
-all build: ttf-dir
+all build: otf-dir ttf-dir
 
 versionupdate:
 	$(PYTHON) $(FONTVERSION_UPDATE_SCRIPT) $(SRCDIR) $(VER)
@@ -68,6 +70,17 @@ ttf-dir:: $(SFDFILES)
 	mkdir -p $(DISTPREFIX_TTF)
 	mv $(addsuffix .ttf,$(basename $^)) $(DISTPREFIX_TTF)
 
+FORMATS += otf
+otf-dir:: $(SFDFILES)
+	$(FONTFORGE) -script $(EXPORTSCRIPT) -otf $^
+	$(PYTHON) $(FONTTOOLSCRIPT) src/LiberationMono-*.otf
+	mv  src/LiberationMono-Regular-fixed.otf  src/LiberationMono-Regular.otf
+	mv  src/LiberationMono-Italic-fixed.otf  src/LiberationMono-Italic.otf
+	mv  src/LiberationMono-Bold-fixed.otf  src/LiberationMono-Bold.otf
+	mv  src/LiberationMono-BoldItalic-fixed.otf  src/LiberationMono-BoldItalic.otf
+	mkdir -p $(DISTPREFIX_OTF)
+	mv $(addsuffix .otf,$(basename $^)) $(DISTPREFIX_OTF)
+
 # web sites usage
 # Web Open Font Format (WOFF); for all modern browsers (W3C recommendation)
 FORMATS += woff
-- 
2.34.1

